<?php



    DEFINE ("__AJAX", TRUE);  // Without Sessions from configuration

require_once ('../Library/Ajax/Ajax.php');
$_return = NULL;


$results = $_GET;

$query = Ajax_Call::IN($results['q']);
$id = Ajax_Call::IN($results['id']);


$sql = 'SELECT field_data.*  FROM field_data WHERE var44 like ? AND auth_id=? limit 0,20';
$sql_param = array("%$query%", $id);


$_return .= '<div class="alert alert-info" > ';



$logging = $db->rawQuery($sql, $sql_param); // ORDER BY date DESC"


foreach ($logging as $t) {

    $title = !empty($t['var44']) ? $t['var44'] : "χωρίς τίτλο";

    $img     = $t['var54'] ? '<img width="70px;" src="data:image/jpeg;base64,' . base64_encode($t['var54']) . ' " />' : NULL;
    $keimeno = isset($t['var45']) ? $t['var45'] : "χωρίς κείμενο";
    $sold    = $t['var54'] ? " []" : " ";

    $_return .= '<p> <a  href="login.php?page=user_panel_aggelies&id='.$t['id'].'"> '.$title .'  </a> '. $sold .'  </p>';
}

$_return .= '</div>';



echo $_return;

?>
